import type { RouteRecordRaw } from 'vue-router'

/** 默认布局 */
const Layout = () => import('@/layout/index.vue')

/** 系统路由 */
export const systemRoutes: RouteRecordRaw[] = [
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/login/index.vue'),
    meta: { hidden: true }
  },
  {
    path: '/',
    name: 'Home',
    component: Layout,
    redirect: '/home/workspace',
    meta: { title: '主页', icon: 'gi-menu-home', iconSize: 24, hidden: false, breadcrumb: true },
    children: [
      {
        path: '/home/workspace',
        name: 'HomeWorkspace',
        component: () => import('@/views/home/workspace/index.vue'),
        meta: { title: '工作台', icon: 'desktop', iconSize: 18, hidden: false, affix: true, breadcrumb: true }
      },
      {
        path: '/home/analysis',
        name: 'HomeAnalysis',
        component: () => import('@/views/home/analysis/index.vue'),
        meta: { title: '分析页', icon: 'insert-chart', iconSize: 18, hidden: false, affix: false, breadcrumb: true }
      },
      {
        path: '/home/profile',
        name: 'HomeProfile',
        component: () => import('@/views/home/profile/index.vue'),
        meta: { title: '个人中心', icon: 'user', iconSize: 18, hidden: false, affix: false, breadcrumb: true }
      },
      {
        path: '/home/message',
        name: 'HomeMessage',
        component: () => import('@/views/home/message/index.vue'),
        meta: { title: '消息中心', icon: 'message', iconSize: 18, hidden: false, affix: false, breadcrumb: true }
      }
    ]
  },
  {
    path: '/thirdparty/callback',
    component: () => import('@/views/login/thirdparty/index.vue'),
    meta: { hidden: true }
  },
  {
    path: '/pwdExpired',
    component: () => import('@/views/login/pwdExpired/index.vue'),
    meta: { hidden: true }
  }
]

// 固定路由（默认路由）
export const constantRoutes: RouteRecordRaw[] = [
  {
    path: '/redirect',
    component: Layout,
    meta: { hidden: true },
    children: [
      {
        path: '/redirect/:path(.*)',
        component: () => import('@/views/default/redirect/index.vue')
      }
    ]
  },
  {
    path: '/:pathMatch(.*)*',
    component: () => import('@/views/default/error/404.vue'),
    meta: { hidden: true }
  },
  {
    path: '/403',
    component: () => import('@/views/default/error/403.vue'),
    meta: { hidden: true }
  }
]
